<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org" lang="zh-CN">

<div class="container">
    <form id="configEditForm" class="form-horizontal" role="form">
        <div class="row text-center">
            <div class="page-header">
                <h3>系统参数</h3>
            </div>
        </div>

        <!-- 操作 -->
        <div class="row">
            <!-- 系统参数配置 -->
            <div class="form-group">
                <div class="text-right col-sm-4"></div>
                <div class="text-right col-sm-8">
                    <button id="updateSystemSubBtn" type="button" class="btn btn-primary">
                        <span class="fa fa-save"></span>保存
                    </button>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label">同步数据过期时间(天)<strong class="text-primary">*</strong></label>
                <div class="col-sm-4">
                    <input type="number" class="form-control" min="1" max="180" dbsyncer-valid="require" name="expireDataDays" th:value="${config?.expireDataDays}"/>
                </div>
                <label class="col-sm-2 control-label">系统日志过期时间(天)<strong class="text-primary">*</strong></label>
                <div class="col-sm-4">
                    <input type="number" class="form-control" min="1" max="180" dbsyncer-valid="require" name="expireLogDays" th:value="${config?.expireLogDays}"/>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">CDN静态资源</label>
                <div class="col-sm-4">
                    <input class="dbsyncer_switch" name="enableCDN" th:checked="${config?.enableCDN}" type="checkbox" />
                </div>
                <label class="col-sm-2 control-label">刷新监控频率(秒)<strong class="text-primary">*</strong></label>
                <div class="col-sm-4">
                    <input type="number" class="form-control" min="1" max="60" dbsyncer-valid="require" name="refreshIntervalSeconds" th:value="${config?.refreshIntervalSeconds}"/>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">记录同步成功数据</label>
                <div class="col-sm-4">
                    <input class="dbsyncer_switch" name="enableStorageWriteSuccess" th:checked="${config?.enableStorageWriteSuccess}" type="checkbox" />
                </div>
                <label class="col-sm-2 control-label">记录全量数据<i class="fa fa-question-circle fa_gray" aria-hidden="true" title="不推荐在生产环境下开启，可在源库数据量较少时使用，一般用于测试"></i></label>
                <div class="col-sm-4">
                    <input class="dbsyncer_switch" name="enableStorageWriteFull" th:checked="${config?.enableStorageWriteFull}" type="checkbox" />
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">记录同步失败数据</label>
                <div class="col-sm-4">
                    <input id="enableStorageWriteFail" name="enableStorageWriteFail" th:checked="${config?.enableStorageWriteFail}" type="checkbox" />
                </div>
                <div id="maxStorageErrorLength" class="hidden">
                    <label class="col-sm-2 control-label">记录同步失败日志长度<strong class="text-primary">*</strong></label>
                    <div class="col-sm-4">
                        <input type="number" class="form-control" min="1024" max="8192" dbsyncer-valid="require" name="maxStorageErrorLength" th:value="${config?.maxStorageErrorLength}"/>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">水印<i class="fa fa-question-circle fa_gray" aria-hidden="true" title="刷新页面生效"></i></label>
                <div class="col-sm-4">
                    <input id="enableWatermark" name="enableWatermark" th:checked="${config?.enableWatermark}" type="checkbox" />
                </div>
                <div id="watermark" class="hidden">
                    <label class="col-sm-2 control-label">水印内容</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" maxlength="64" name="watermark" placeholder="请输入水印(最多64个字)." th:value="${config?.watermark}"/>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">标准数据解析器</label>
                <div class="col-sm-4">
                    <input class="dbsyncer_switch" id="enableSchemaResolver" name="enableSchemaResolver" th:checked="${config?.enableSchemaResolver}" type="checkbox" />
                </div>
            </div>
        </div>
    </form>
</div>

<script th:src="@{/js/system/index.js}"></script>
</html>